package com.pfzy.utildemo.activity.record.soundrecord.util;

import java.util.Collection;
import java.util.Map;

/**
 * 记录集合
 */
public class RecordCollectionsUtil {
    public static boolean isEmpty(Collection collection) {
        return getSize(collection) == 0;
    }

    public static boolean isEmpty(Map map) {
        return getSize(map) == 0;
    }

    public static int getSize(Map map) {
        if (map == null) {
            return 0;
        }
        return map.size();
    }

    public static int getSize(Collection collection) {
        if (collection == null) {
            return 0;
        }
        return collection.size();
    }

    public static boolean isEmpty(Object[] array) {
        return array == null || array.length == 0;
    }

    public static int getSize(Object[] array) {
        if (array == null) {
            return 0;
        }
        return array.length;
    }
}
